package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 类说明：会员类型
 *
 * @author jun.liu
 */
public enum MemberTypes implements EnumerableValue
{

    cside(1, "C端"),
    bside(2, "B端"),
    virtual(3, "虚拟端");

    public static class Converter extends BaseEnumValueConverter<MemberTypes>
    {
    }

    private int value;
    private String desc;

    private MemberTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static MemberTypes getRefereeTypeByValue(int codeVal)
    {
        for (MemberTypes refereeType : MemberTypes.values()) {
            if (refereeType.getValue() == codeVal) {
                return refereeType;
            }
        }
        return null;
    }
}
